<?php

namespace backend\models;

use Yii;

class BrandHead extends \yii\db\ActiveRecord
{
    public $imgurl;
	 
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'grp_brand_head';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {    	
        return [
            [['id'], 'integer'],
        	[['name'], 'unique','message'=>'名称已存在，请输入新名称'],
        ];
    }
    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => Yii::t('app','名称'),
            'imgurl'=>'图片',
            'img_id'=>'图片'
        ];
    }
    public function getSysImage()
    {
    	return $this->hasOne(SysImage::className(),['id'=>'img_id']);
    }
    
}
